package com.wn.ticket.web;

import com.wn.ticket.common.ResponseEntity;
import com.wn.ticket.entity.Category;
import com.wn.ticket.service.CategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/front/category")
public class CategoryController {
    @Autowired
    private CategoryService categoryService;

    @GetMapping("/getAll")
    public ResponseEntity getAll() {
        List<Category> list = categoryService.getAll();

        return new ResponseEntity(list);
    }
}
